<!DOCTYPE html>
<html lang="zh-cn" data-lang-code="zh-cn">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=9,chrome=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>RAID 容量计算器 cnuu.net</title>
<meta name="description" content="RAID容量计算器，cnuu.net根据asustor修改制作，可直观配置RAID">
<meta name="keywords" content="RAID容量计算,RAID计算器,在线RAID">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<script src="js/jquery-1.7.1.min.js"></script>
<style type="text/css">
body
{
	font-size:14px;
}
	
        #prbar, #prbar_b
        {
            margin:0px;
            width: 100%;
            background-color:#dddddd;
            overflow:hidden;
    
            /* Rounded Border */
            /*border: 1px solid #bbbbbb;*/
            -moz-border-radius: 4px;
            border-radius: 4px;
			height:33px;
			
	
            
            /* Adding some shadow to the progress bar */
                   
        }
        
        /* No rounded corners for Opera, because the overflow:hidden dont work with rounded corners */
        doesnotexist:-o-prefocus, #prbar {
          border-radius:0px;
        }
		#hint, #hint_b
        {
           
            width:100%;
            height:33px;
			
			text-align: left;
			color:#666;
			padding:6px 0px;
			text-indent:10px;
            
        
        }
        #prpos, #prpos_b
        {
            background-color:#5EB95E;
            width:0%;
            height:33px;
			
            
            /* CSS3 Progress Bar Transitions */
            transition: width 2s ease;
            -moz-transition: width 2s ease;
            -webkit-transition: width 2s ease;
            -o-transition: width 2s ease;
            -ms-transition: width 2s ease;
   
            /* Background stripes animation */
            animation: bganim 3s linear 2s infinite;
            -moz-animation: bganim 3s linear 2s infinite;
            -webkit-animation: bganim 3s linear 2s infinite;
            -o-animation: bganim 3s linear 2s infinite;
            -ms-animation: bganim 3s linear 2s infinite;
			
			color:#FFF;
			line-height:24px;
			padding: 5px 0px 6px 0px;
			text-align:center;
		
        }
		 #prpos2, #prpos2_b
        {
            background-color:#3399ff;
            width:0%;
            height:33px;
			
			
			 transition: width 2s ease;
            -moz-transition: width 2s ease;
            -webkit-transition: width 2s ease;
            -o-transition: width 2s ease;
            -ms-transition: width 2s ease;
       
            /* Background stripes animation */
            animation: bganim 3s linear 2s infinite;
            -moz-animation: bganim 3s linear 2s infinite;
            -webkit-animation: bganim 3s linear 2s infinite;
            -o-animation: bganim 3s linear 2s infinite;
            -ms-animation: bganim 3s linear 2s infinite;
			
			text-align:center;
			color:#FFF;
				line-height:24px;
			padding: 5px 0px 6px 0px;
        }
         #prpos3, #prpos3_b
        {
           
            width:0%;
            height:32px;
		
			 transition: width 2s ease;
            -moz-transition: width 2s ease;
            -webkit-transition: width 2s ease;
            -o-transition: width 2s ease;
            -ms-transition: width 2s ease;       
            /* Background stripes animation */
            animation: bganim 3s linear 2s infinite;
            -moz-animation: bganim 3s linear 2s infinite;
            -webkit-animation: bganim 3s linear 2s infinite;
            -o-animation: bganim 3s linear 2s infinite;
            -ms-animation: bganim 3s linear 2s infinite;
			
			text-align:center;
			color:#666;
			line-height:24px;
			padding: 5px 0px 6px 0px;
                   
        }
		
#hard_drive li
{
 	list-style: none;
    display: inline-block;
    width: 64px;
    height: 70px;
    margin: 0 15px 15px 0;
    position: relative;
    background-image: url("images/disk.png");
    text-align: center;
    padding-top: 25px;
    text-indent: 15px;
	cursor: move;
    background-repeat: no-repeat;
    font-size: 13px;	
	
}
#tray_out
{
	position:absolute; 
	top:0px; 
	left:-40px;
	width:640px; 
	height:200px;
	text-align:left;

	
}
.tray
{

	list-style: none;
    display: inline-block;
    width: 60px;
    height: 200px;
    margin: 0px -10px 0px 0px;
	float:left;
    background-image: url("images/tray.png");
    text-align: center;
    padding-top: 45px;
    text-indent: -10px;
	color:#FFFFFF;
    background-repeat: no-repeat;
    font-size: 14px;
	cursor:move;
	
}
.tray:hover
{

    background-image: url("images/tray_hover.png");
	
}
.tray0
{
 	list-style: none;
    display: inline-block;
    width: 60px;
    height: 200px;
    margin: 0px -10px 0px 0px;
    position: relative;
	left:-500px;
    background-image: url("images/tray.png");
    text-align: center;
    padding-top: 45px;
    text-indent: -10px;
	color:#FFFFFF;
    background-repeat: no-repeat;
    font-size: 14px;

	
}
/*============按鈕================================*/

#NAS_screen
{
	position: absolute; 
	top:28px; 
	left:140px; 
	width:61%;
	z-index:auto; 
	color:#CCC;
	
}
#user_guide
{
	width:600px;
	height:200px;
	position:absolute; 
	top:0px; 
	left:0px;  
	border: #C4ECE5 solid 2px;
	border-radius:5px;
	text-align:center;
	padding: 10px 0px 20px 0px;	
	
}


.grey_dot
{
	background-image:url("images/templates/grey_dot.png");
	
}


.info
{
	background:#46cab0;
	border-radius:90%;
	padding: 0px 8px;
	color:#FFF;
	font-weight:600;
	margin-right:3px;	
}
.info:hover
{
	background:#57c1d4;
	color:#FFF;
	font-weight:600;
	margin-right:3px;
	text-decoration:none;	
}

.recommand
{
	display:none;
	padding: 0px 0px 10px 0px;
}



#hd_num, #click_num
{
	font-size:1.2em;
	color:#BACFDA;
	
}

</style>
</head>
<body>
<div class="container" style="margin: 0px auto; width:100%; min-height:700px" onload="MoveTo();">
	<div class="row"  style=" padding: 0px 0px 10px 0px;" onselectstart="return false">
		<div class="col-md-12 col-xs-8" align="left">
			<h3>RAID 容量计算器</h3>
		</div>
		<div class="col-md-8 col-xs-8" align="center" style="height:300px;" onselectstart="return false">
			<div id="NAS_screen">
				<div  style="float:left"> 硬盘数: <span id="hd_num">0</span> </div>
				<div style="float:left; display:none;"> 點擊次數: <span id="click_num">0</span> </div>
			</div>
			<img src="images/raid_body.png" style="width:auto; z-index:9000" draggable="false"/>
			<div style="width:600px;position:relative; top:-215px; left:25px;">
				<div id="user_guide" style="" align="center">
					<h4 style="color:#FFFFFF">拖曳硬盘到这里</h4>
					<ul style="color:#FFF; text-align:left; padding-right:25px;">
						<li>步骤一: 选择您所需的硬盘，点击或拖曳至硬盘插槽; 反之，点击可将其移除。 </li>
						<li>步骤二: 挑选您想要设置的RAID 型态， 硬盘的空间配置结果会立刻显示出来。 </li>
					</ul>
				</div>
				<ul id="tray_out" ondrop="drop(event)" ondragover="allowDrop(event)">
					<li class="tray0" id="tray0" style="display:none"> &nbsp;</li>
				</ul>
			</div>
		</div>
		<div class="col-md-4 col-xs-8" style="position:relative; left:-60px;">
			<ul id="hard_drive">
				<li class="hvr-rotate" id="hd11" data-size="12000" draggable="true" ondragstart="drag(event)" id="drag11">
				12T
				</li>
				<li class="hvr-rotate" id="hd0" data-size="10000" draggable="true" ondragstart="drag(event)" id="drag0">
				10T
				</li>
				<li class="hvr-rotate" id="hd1" data-size="8000" draggable="true" ondragstart="drag(event)" id="drag1">
				8T
				</li>
				<li class="hvr-rotate" id="hd2" data-size="6000" draggable="true" ondragstart="drag(event)" id="drag1">
				6T
				</li>
				<li class="hvr-rotate" id="hd3" data-size="5000" draggable="true" ondragstart="drag(event)" id="drag1">
				5T
				</li>
				<li class="hvr-rotate" id="hd4" data-size="4000" draggable="true" ondragstart="drag(event)" id="drag1">
				4T
				</li>
				<li class="hvr-rotate" id="hd5" data-size="3000" draggable="true" ondragstart="drag(event)" id="drag1">
				3T
				</li>
				<li class="hvr-rotate" id="hd6" data-size="2000" draggable="true" ondragstart="drag(event)" id="drag1">
				2T
				</li>
				<li class="hvr-rotate" id="hd7" data-size="1500" draggable="true" ondragstart="drag(event)" id="drag1">
				1.5T
				</li>
				<li class="hvr-rotate" id="hd8" data-size="1000" draggable="true" ondragstart="drag(event)" id="drag1">
				1T
				</li>
				<li class="hvr-rotate" id="hd9" data-size="750" draggable="true" ondragstart="drag(event)" id="drag1">
				750GB
				</li>
				<li class="hvr-rotate" id="hd10" data-size="500" draggable="true" ondragstart="drag(event)" id="drag1">
				500GB
				</li>
				<li class="hvr-rotate" id="hd11" data-size="300" draggable="true" ondragstart="drag(event)" id="drag1">
				300GB
				</li>
				<li class="hvr-rotate" id="hd11" data-size="250" draggable="true" ondragstart="drag(event)" id="drag1">
				250GB
				</li>
			</ul>
		</div>
	</div>
	<div class="row" style="margin-top:30px;">
		<div class="col-md-4 col-xs-8" > <a class="info" >i</a>RAID 型态 </div>
		<div class="col-md-8 col-xs-8">
			<ul style="display: inline; list-style: none">
				<li style="float:right;margin:0px 20px;"> <img src="images/grey_dot.png" style="margin-right:3px; position:relative;top:-1px;"/> 未利用的空间 </li>
				<li style="float:right;margin:0px 20px;"> <img src="images/blue_dot.png" style="margin-right:3px;position:relative;top:-1px;"/> 用于资料保护 </li>
				<li style="float:right;margin:0px 20px;"> <img src="images/green_dot.png" style="margin-right:3px;position:relative;top:-1px;"/> 可用空间 </li>
				<li style="float:right;margin:0px 20px; list-style:none">空间配置:</li>
			</ul>
		</div>
	</div>
	<div class="row"  style=" padding: 10px 0px 10px 0px;">
		<div class="col-md-2 col-xs-8" align="center" >
			<select id="raid_type" style="width:110%">
				<option value="raid0">RAID 0</option>
				<option value="raid1" selected="selected">RAID 1</option>
				<option value="raid5">RAID 5</option>
				<option value="raid6">RAID 6</option>
				<option value="raid10">RAID 10</option>
			</select>
		</div>
		<div class="col-md-10 col-xs-8" align="center" >
			<div id="prbar">
				<div id="hint" style="float:left"><img src="images/exclamation_mark.png" style="margin:-3px 5px 0px 0px;"> 硬盘数量不足，为这个 RAID 形态拖曳更多颗硬盘</div>
				<div id="prpos" style="float:left"></div>
				<div id="prpos2" style="float:left"></div>
				<div id="prpos3" style="float:left"></div>
			</div>
		</div>
	</div>
	<div class="row"  style=" padding: 0px 0px 10px 0px;">
		<div class="col-md-2 col-xs-8" align="center" >
			<select id="raid_type_b" style="width:110%">
				<option value="raid0" >RAID 0</option>
				<option value="raid1">RAID 1</option>
				<option value="raid5" selected="selected">RAID 5</option>
				<option value="raid6">RAID 6</option>
				<option value="raid10">RAID 10</option>
			</select>
		</div>
		<div class="col-md-10 col-xs-8" align="center" >
			<div id="prbar_b">
				<div id="hint_b" style="float:left"><img src="images/exclamation_mark.png" style="margin:-3px 5px 0px 0px;"> 硬盘数量不足，为这个 RAID 形态拖曳更多颗硬盘</div>
				<div id="prpos_b" style="float:left"></div>
				<div id="prpos2_b" style="float:left"></div>
				<div id="prpos3_b" style="float:left"></div>
			</div>
		</div>
	</div>
	<div class="row"  style=" padding: 10px 0px 50px 0px; margin-top:40px; border-top:thin #CCC solid;	">
		<div class="col-md-12 col-xs-8" align="left">
			<div class="note"> 作者: <br/>
				cnuu.net根据asustor修改制作。 </div>
		</div>
	</div>
</div>
<script>
$(document).ready(function(){
	//全部隱藏
	//$(".tray").hide();
	
	$("#hard_drive li").click(function(){
		
			
			var _click =  parseInt($("#click_num").text());	
			 _click = parseInt(_click) + 1;	
			//alert(_click);
			
			
		 $("#click_num").text(_click);		
			
			
			//alert(_click);
		
		//============超過10個不能新增===========================================
		var _tray_num = $('#tray_out').children('li').length;
		
		
		
		//========硬碟數量
		if(_tray_num <= 12)
		{
			$("#hd_num").text(_tray_num);
		}
		//============超過一個關user guide======================================================
		if(_tray_num <= 1)
		{
			$("#user_guide").hide();
		}
		if(_tray_num <= 12)
		{
			$("#tray0").before("<li class='tray' id='tray"+_click+"'> &nbsp;</li>");		
		}
		//============================================================================
		
		
		//=======推薦機種=========================================
		if(_tray_num >=0 && _tray_num <=2)
		{
			$(".recommand").fadeOut();
			$("#2bay").fadeToggle();
		}
		else if(_tray_num >=3 && _tray_num <=4)
		{
			$(".recommand").fadeOut();
			$("#4bay").fadeToggle();	
		}
		else if(_tray_num >=5 && _tray_num <=8)
		{
			$(".recommand").fadeOut();
			$("#8bay").fadeToggle();	
		}
		else if(_tray_num == 9)
		{
			$(".recommand").fadeOut();
			$("#9bay").fadeToggle();	
		}
		else if(_tray_num == 10)
		{
			$(".recommand").fadeOut();
			$("#10bay").fadeToggle();	
		}
		else if(_tray_num >= 11)
		{
			$(".recommand").fadeOut();
			$("#12bay").fadeToggle();	
		}
		else if(_tray_num == 0)
		{
			$(".recommand").fadeOut();
		}
		$("input[type='checkbox']").attr("checked", false);
		//=======推薦機種end=========================================
		
		

			var _size = $(this).attr('data-size');
			//alert(_size);
			
			
			//===========給tray值==========================//
			if(_size >= 1000)
			{
				$("#tray"+_click).html(_size/1000+'TB');
			}
			else
			{
				$("#tray"+_click).html(_size+'GB');		
			}
			
			$("#tray"+_click).attr('data-size',_size);
			//================================================//
			
			
		
			var _raid_type = $("#raid_type").find(":selected").val();
	
	
	var _tray_num = $('#tray_out').children('li').length - 1;
	//==================拿資料計算==========================================
	var _array = new Array();
			
	//全部容量
	var _total = new Number;
	
	$(".tray").each(function(){
    	//alert($(this).attr("data-size"))
		_array.push($(this).attr("data-size"));
		
		_total = parseInt(_total) + parseInt($(this).attr("data-size"));
  	});
			
	var _min =  Math.min.apply(Math,_array);//最小容量
	var _max = 	Math.max.apply(Math,_array);//最大容量
			//=============================================================
	
	
	//========分條件=========================================================
	if(_raid_type == 'raid0' && _tray_num >= 1)
	{
		 	//===========派值RAID0=======================
		
		 	 //關閉提示
			 $("#hint").attr("style","display:none;");	
			
			 var _bar1 = 100;
			 $("#prpos").attr("style","float:left;width:"+_bar1+"%");
			 
			 var _bar2 = 0;
			 $("#prpos2").attr("style","float:left;width:"+_bar2+"%");
			 
			 var _bar3 =  0;  
			 $("#prpos3").attr("style","float:left;width:"+_bar3+"%");
			 
			 	 
			 if(_total <= 999)
			 {
				_total = _total + " GB"
			 }
			 else
			 {
				_total = (_total / 1000)+" TB"	 
			 }
			 
			 $("#prpos").text(_total);
						 
			 $("#prpos2").text('');

			 $("#prpos3").text('');
			 	
	}
	else if(_raid_type == 'raid1')
	{
			//===========派值RAID1=======================
		if(_tray_num >= 2)
		{	
		 	 //關閉提示
			 $("#hint").attr("style","display:none;");	
			
			 var _bar1 = (_min / _total) * 100;
			 $("#prpos").attr("style","float:left;width:"+_bar1+"%");
			 
			 
			 
			 
			 var _bar2 = (_min / _total) * 100;
			 var _bar2_capacity = _min;
			 
			 
			 $("#prpos2").attr("style","float:left;width:"+_bar1+"%");
			 
			 var _bar3 =  ((_total - (2 * _min)) / _total) * 100;  
			 var _bar3_capacity = _total - (2 *_min);

			 $("#prpos3").attr("style","float:left;width:"+_bar3+"%");
			 
			 	 
			 if(_min <= 999)
			 {
				_min = _min+" GB"
			 }
			 else
			 {
				_min = (_min / 1000)+" TB"	 
			 }
			 
			 $("#prpos").text(_min);
			 
			 
			 if(_bar2_capacity == 0)
			 {
				 _bar2_capacity = '';
			 }
			 else if(_bar2_capacity <= 999)
			 {
				_bar2_capacity = _bar2_capacity +" GB"
			 }
			 else
			 {
				_bar2_capacity = (_bar2_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos2").text(_bar2_capacity);
			 
			 
			 
			 
			 if(_bar3_capacity == 0)
			 {
				 _bar3_capacity = '';
			 }
			 else if(_bar3_capacity <= 999)
			 {
				_bar3_capacity = _bar3_capacity +" GB"
			 }
			 else
			 {
				_bar3_capacity = (_bar3_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos3").text(_bar3_capacity);
			 
			 
 
			 
		}
		else
		{
				 //關閉提示
			 $("#hint").attr("style","");		
		}
	}
	else if(_raid_type == 'raid5')
	{
			//===========派值RAID5=======================
		if(_tray_num >= 3)
		{	
		 	 //關閉提示
			 $("#hint").attr("style","display:none;");	
			
			 var _bar1 = (_min / _total) * 100;
			
			 
			 var _bar2 = (_min * (_tray_num - 1) / _total) * 100;
			 var _bar2_capacity = _min * (_tray_num - 1);
			 
			 
			 $("#prpos2").attr("style","float:left;width:"+_bar1+"%");
			 $("#prpos").attr("style","float:left;width:"+_bar2+"%");
			
			
			 
			 var _bar3 =  ((_total - (_tray_num * _min)) / _total) * 100;  
			 var _bar3_capacity = _total - (_tray_num * _min);

			 $("#prpos3").attr("style","float:left;width:"+_bar3+"%");
			 
			 	 
			 if(_min <= 999)
			 {
				_min = _min+" GB"
			 }
			 else
			 {
				_min = (_min / 1000)+" TB"	 
			 }
			 
			 $("#prpos2").text(_min);
			 
			 
			 if(_bar2_capacity == 0)
			 {
				 _bar2_capacity = '';
			 }
			 else if(_bar2_capacity <= 999)
			 {
				_bar2_capacity = _bar2_capacity +" GB"
			 }
			 else
			 {
				_bar2_capacity = (_bar2_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos").text(_bar2_capacity);
			 
			 
			 
			 
			 if(_bar3_capacity == 0)
			 {
				 _bar3_capacity = '';
			 }
			 else if(_bar3_capacity <= 999)
			 {
				_bar3_capacity = _bar3_capacity +" GB"
			 }
			 else
			 {
				_bar3_capacity = (_bar3_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos3").text(_bar3_capacity);
			 
 
			 
		}
		else
		{
				 //關閉提示
			 $("#hint").attr("style","");		
		}	
	}
	else if(_raid_type == 'raid6')
	{
			//===========派值RAID6=======================
		if(_tray_num >= 4)
		{	
		 	 //關閉提示
			 $("#hint").attr("style","display:none;");	
			
			 var _bar1 = ((_min * (_tray_num - 2)) / _total) * 100;
			  var _bar1_capacity = _min * (_tray_num - 2);
			 
			 $("#prpos").attr("style","float:left;width:"+_bar1+"%");
			 
			 
			 
			 
			 var _bar2 = ((_min * 2) / _total) * 100;
			 var _bar2_capacity = _min * 2;
			 
			
			 
			 
			 
			 $("#prpos2").attr("style","float:left;width:"+_bar2+"%");
			 
			 var _bar3 =  ((_total - (_bar1_capacity + _bar2_capacity)) / _total) * 100;  
			 var _bar3_capacity = _total - (_bar1_capacity + _bar2_capacity);

			 $("#prpos3").attr("style","float:left;width:"+_bar3+"%");
			 
				 
				 
			 if(_bar1_capacity <= 999)
			 {
				_bar1_capacity = _bar1_capacity+" GB"
			 }
			 else
			 {
				_bar1_capacity = (_bar1_capacity / 1000)+" TB"	 
			 }
			 
			 $("#prpos").text(_bar1_capacity);
			 
			 
			 if(_bar2_capacity == 0)
			 {
				 _bar2_capacity = '';
			 }
			 else if(_bar2_capacity <= 999)
			 {
				_bar2_capacity = _bar2_capacity +" GB"
			 }
			 else
			 {
				_bar2_capacity = (_bar2_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos2").text(_bar2_capacity);
			 
			 
			 //alert(_bar3_capacity);
			 
			 if(_bar3_capacity == 0)
			 {
				 _bar3_capacity = '';
			 }
			 else if(_bar3_capacity <= 999)
			 {
				_bar3_capacity = _bar3_capacity +" GB"
			 }
			 else
			 {
				_bar3_capacity = (_bar3_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos3").text(_bar3_capacity);
			 
 
			 
		}
		else
		{
				 //關閉提示
			 $("#hint").attr("style","");		
		}	
	}	
	else if(_raid_type == 'raid10')
	{
			//===========派值RAID10=======================
		if(_tray_num >= 4 && _tray_num%2 == 0)
		{	
		 	 //關閉提示
			 $("#hint").attr("style","display:none;");	
			
			 var _bar1 = ((_min * (_tray_num / 2)) / _total) * 100;
			  var _bar1_capacity = _min * (_tray_num / 2);
			 
			 $("#prpos").attr("style","float:left;width:"+_bar1+"%");
			 
			 
			 
			 
			 var _bar2 = ((_min * (_tray_num / 2)) / _total) * 100;
			 var _bar2_capacity = _min * (_tray_num / 2);
			 
			 
			 $("#prpos2").attr("style","float:left;width:"+_bar2+"%");
			 
			 var _bar3 =  ((_total - (_bar1_capacity + _bar2_capacity)) / _total) * 100;  
			 var _bar3_capacity = _total - (_bar1_capacity + _bar2_capacity);

			 $("#prpos3").attr("style","float:left;width:"+_bar3+"%");
			 
				 
				 
			 if(_bar1_capacity <= 999)
			 {
				_bar1_capacity = _bar1_capacity+" GB"
			 }
			 else
			 {
				_bar1_capacity = (_bar1_capacity / 1000)+" TB"	 
			 }
			 
			 $("#prpos").text(_bar1_capacity);
			 
			 
			 if(_bar2_capacity == 0)
			 {
				 _bar2_capacity = '';
			 }
			 else if(_bar2_capacity <= 999)
			 {
				_bar2_capacity = _bar2_capacity +" GB"
			 }
			 else
			 {
				_bar2_capacity = (_bar2_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos2").text(_bar2_capacity);
			 
			 
			 //alert(_bar3_capacity);
			 
			 if(_bar3_capacity == 0)
			 {
				 _bar3_capacity = '';
			 }
			 else if(_bar3_capacity <= 999)
			 {
				_bar3_capacity = _bar3_capacity +" GB"
			 }
			 else
			 {
				_bar3_capacity = (_bar3_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos3").text(_bar3_capacity);
			 
 
			 
		}
		else
		{
				 //關閉提示
			 $("#hint").attr("style","");		
		}		
	}
		
	
	
	
	
	
	//==================拿資料計算==========================================
	var _array = new Array();
			
	//全部容量
	var _total = new Number;
	
	$(".tray").each(function(){
    	//alert($(this).attr("data-size"))
		_array.push($(this).attr("data-size"));
		
		_total = parseInt(_total) + parseInt($(this).attr("data-size"));
  	});
			
	var _min =  Math.min.apply(Math,_array);//最小容量
	var _max = 	Math.max.apply(Math,_array);//最大容量
	
	var _raid_type_b = $("#raid_type_b").find(":selected").val(); //下拉選單b type
			//=============================================================
	
	<!--==========================Bar B==================================================================-->
	if(_raid_type_b == 'raid0' && _tray_num >= 1)
	{
		 	//===========派值RAID0=======================
		
		 	 //關閉提示
			 $("#hint_b").attr("style","display:none;");	
			
			 var _bar1_b = 100;
			 $("#prpos_b").attr("style","float:left;width:"+_bar1_b+"%");
			 
			 var _bar2_b = 0;
			 $("#prpos2_b").attr("style","float:left;width:"+_bar2_b+"%");
			 
			 var _bar3_b =  0;  
			 $("#prpos3_b").attr("style","float:left;width:"+_bar3_b+"%");
			 
			 	 
			 if(_total <= 999)
			 {
				_total = _total + " GB"
			 }
			 else
			 {
				_total = (_total / 1000)+" TB"	 
			 }
			 
			 $("#prpos_b").text(_total);
						 
			 $("#prpos2_b").text('');

			 $("#prpos3_b").text('');
			 	
	}
	else if(_raid_type_b == 'raid1')
	{
			//===========派值RAID1=======================
		if(_tray_num >= 2)
		{	
		 	  //關閉提示
			 $("#hint").attr("style","display:none;");	
			
			 var _bar1 = (_min / _total) * 100;
			 $("#prpos").attr("style","float:left;width:"+_bar1+"%");
			 
			 
			 
			 
			 var _bar2 = (_min / _total) * 100;
			 var _bar2_capacity = _min;
			 
			 
			 $("#prpos2").attr("style","float:left;width:"+_bar1+"%");
			 
			 var _bar3 =  ((_total - (2 * _min)) / _total) * 100;  
			 var _bar3_capacity = _total - (2 *_min);

			 $("#prpos3").attr("style","float:left;width:"+_bar3+"%");
			 
			 	 
			 if(_min <= 999)
			 {
				_min = _min+" GB"
			 }
			 else
			 {
				_min = (_min / 1000)+" TB"	 
			 }
			 
			 $("#prpos").text(_min);
			 
			 
			 if(_bar2_capacity == 0)
			 {
				 _bar2_capacity = '';
			 }
			 else if(_bar2_capacity <= 999)
			 {
				_bar2_capacity = _bar2_capacity +" GB"
			 }
			 else
			 {
				_bar2_capacity = (_bar2_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos2").text(_bar2_capacity);
			 
			 
			 
			 
			 if(_bar3_capacity == 0)
			 {
				 _bar3_capacity = '';
			 }
			 else if(_bar3_capacity <= 999)
			 {
				_bar3_capacity = _bar3_capacity +" GB"
			 }
			 else
			 {
				_bar3_capacity = (_bar3_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos3").text(_bar3_capacity);
			 
			 
 
			 
		}
		else
		{
				 //關閉提示
			 $("#hint_b").attr("style","");		
		}
	}
	else if(_raid_type_b == 'raid5')
	{
			//===========派值RAID5=======================
		if(_tray_num >= 3)
		{	
		 	 //關閉提示
			 $("#hint_b").attr("style","display:none;");	
			
			 var _bar1_b = (_min / _total) * 100;
			
			 
			 var _bar2_b = (_min * (_tray_num - 1) / _total) * 100;
			 var _bar2_b_capacity = _min * (_tray_num - 1);
			 
			 
			 $("#prpos2_b").attr("style","float:left;width:"+_bar1_b+"%");
			 $("#prpos_b").attr("style","float:left;width:"+_bar2_b+"%");
			
			
			 
			 var _bar3_b =  ((_total - (_tray_num * _min)) / _total) * 100;  
			 var _bar3_b_capacity = _total - (_tray_num * _min);

			 $("#prpos3_b").attr("style","float:left;width:"+_bar3_b+"%");
			 
			 	 
			 if(_min <= 999)
			 {
				_min = _min+" GB"
			 }
			 else
			 {
				_min = (_min / 1000)+" TB"	 
			 }
			 
			 $("#prpos2_b").text(_min);
			 
			 
			 if(_bar2_b_capacity == 0)
			 {
				 _bar2_b_capacity = '';
			 }
			 else if(_bar2_b_capacity <= 999)
			 {
				_bar2_b_capacity = _bar2_b_capacity +" GB"
			 }
			 else
			 {
				_bar2_b_capacity = (_bar2_b_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos_b").text(_bar2_b_capacity);
			 
			 
			 
			 
			 if(_bar3_b_capacity == 0)
			 {
				 _bar3_b_capacity = '';
			 }
			 else if(_bar3_b_capacity <= 999)
			 {
				_bar3_b_capacity = _bar3_b_capacity +" GB"
			 }
			 else
			 {
				_bar3_b_capacity = (_bar3_b_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos3_b").text(_bar3_b_capacity);
			 
 
			 
		}
		else
		{
				 //關閉提示
			 $("#hint_b").attr("style","");		
		}	
	}
	else if(_raid_type_b == 'raid6')
	{
			//===========派值RAID6=======================
		if(_tray_num >= 4)
		{	
			
		 	 //關閉提示
			 $("#hint_b").attr("style","display:none;");	
			
			 var _bar1_b = ((_min * (_tray_num - 2)) / _total) * 100;
			  var _bar1_b_capacity = _min * (_tray_num - 2);
			 
			 $("#prpos_b").attr("style","float:left;width:"+_bar1_b+"%");
			 
			 
			 
			 
			 var _bar2_b = ((_min * 2) / _total) * 100;
			 var _bar2_b_capacity = _min * 2;
			 
			
			 
			 
			 
			 $("#prpos2_b").attr("style","float:left;width:"+_bar2_b+"%");
			 
			 var _bar3_b =  ((_total - (_bar1_b_capacity + _bar2_b_capacity)) / _total) * 100;  
			 var _bar3_b_capacity = _total - (_bar1_b_capacity + _bar2_b_capacity);

			 $("#prpos3_b").attr("style","float:left;width:"+_bar3_b+"%");
			 
				 
				 
			 if(_bar1_b_capacity <= 999)
			 {
				_bar1_b_capacity = _bar1_b_capacity+" GB"
			 }
			 else
			 {
				_bar1_b_capacity = (_bar1_b_capacity / 1000)+" TB"	 
			 }
			 
			 $("#prpos_b").text(_bar1_b_capacity);
			 
			 
			 if(_bar2_b_capacity == 0)
			 {
				 _bar2_b_capacity = '';
			 }
			 else if(_bar2_b_capacity <= 999)
			 {
				_bar2_b_capacity = _bar2_b_capacity +" GB"
			 }
			 else
			 {
				_bar2_b_capacity = (_bar2_b_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos2_b").text(_bar2_b_capacity);
			 
			 
			 //alert(_bar3_b_capacity);
			 
			 if(_bar3_b_capacity == 0)
			 {
				 _bar3_b_capacity = '';
			 }
			 else if(_bar3_b_capacity <= 999)
			 {
				_bar3_b_capacity = _bar3_b_capacity +" GB"
			 }
			 else
			 {
				_bar3_b_capacity = (_bar3_b_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos3_b").text(_bar3_b_capacity);
			 
 
			 
		}
		else
		{
				 //關閉提示
			 $("#hint_b").attr("style","");		
		}	
	}	
	else if(_raid_type_b == 'raid10')
	{
		

		//===========派值RAID10=======================
		if(_tray_num >= 4 && _tray_num%2 == 0)
		{	
		 	 //關閉提示
			 $("#hint_b").attr("style","display:none;");	
			
			 var _bar1_b = ((_min * (_tray_num / 2)) / _total) * 100;
			  var _bar1_b_capacity = _min * (_tray_num / 2);
			 
			 $("#prpos_b").attr("style","float:left;width:"+_bar1_b+"%");
			 
			 
			 
			 
			 var _bar2_b = ((_min * (_tray_num / 2)) / _total) * 100;
			 var _bar2_b_capacity = _min * (_tray_num / 2);
			 
			 
			 $("#prpos2_b").attr("style","float:left;width:"+_bar2_b+"%");
			 
			 var _bar3_b =  ((_total - (_bar1_b_capacity + _bar2_b_capacity)) / _total) * 100;  
			 var _bar3_b_capacity = _total - (_bar1_b_capacity + _bar2_b_capacity);

			 $("#prpos3_b").attr("style","float:left;width:"+_bar3_b+"%");
			 
				 
				 
			 if(_bar1_b_capacity <= 999)
			 {
				_bar1_b_capacity = _bar1_b_capacity+" GB"
			 }
			 else
			 {
				_bar1_b_capacity = (_bar1_b_capacity / 1000)+" TB"	 
			 }
			 
			 $("#prpos_b").text(_bar1_b_capacity);
			 
			 
			 if(_bar2_b_capacity == 0)
			 {
				 _bar2_b_capacity = '';
			 }
			 else if(_bar2_b_capacity <= 999)
			 {
				_bar2_b_capacity = _bar2_b_capacity +" GB"
			 }
			 else
			 {
				_bar2_b_capacity = (_bar2_b_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos2_b").text(_bar2_b_capacity);
			 
			 
			 //alert(_bar3_b_capacity);
			 
			 if(_bar3_b_capacity == 0)
			 {
				 _bar3_b_capacity = '';
			 }
			 else if(_bar3_b_capacity <= 999)
			 {
				_bar3_b_capacity = _bar3_b_capacity +" GB"
			 }
			 else
			 {
				_bar3_b_capacity = (_bar3_b_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos3_b").text(_bar3_b_capacity);
			 
 
			 
		}
		else
		{
				 //關閉提示
			 $("#hint_b").attr("style","");		
		}		
	}
	<!--========================Bar B end=======================================================================-->
	
	 
			
	})
	

	
	
	$(".tray").live('click', function() 
	{ 
			var _tray_id = $(this).attr('id');
			
			//alert(_tray_id);
		
			$('#'+_tray_id).remove();	
	
	
	
			var _tray_num = $('#tray_out').children('li').length - 1;
		
			
			
			var _raid_type = $("#raid_type").find(":selected").val();
	
	
	var _tray_num = $('#tray_out').children('li').length - 1;
	
	
	
		//========硬碟數量
		if(_tray_num <= 12)
		{
			$("#hd_num").text(_tray_num);
		}
		//=======推薦機種=========================================
		if(_tray_num >=0 && _tray_num <=2)
		{
			$(".recommand").fadeOut();
			$("#2bay").fadeToggle();
		}
		else if(_tray_num >=3 && _tray_num <=4)
		{
			$(".recommand").fadeOut();
			$("#4bay").fadeToggle();	
		}
		else if(_tray_num >=5 && _tray_num <=8)
		{
			$(".recommand").fadeOut();
			$("#8bay").fadeToggle();	
		}
		else if(_tray_num == 9)
		{
			$(".recommand").fadeOut();
			$("#9bay").fadeToggle();	
		}
		else if(_tray_num == 10)
		{
			$(".recommand").fadeOut();
			$("#10bay").fadeToggle();	
		}
		else if(_tray_num >= 11)
		{
			$(".recommand").fadeOut();
			$("#12bay").fadeToggle();	
		}
		else if(_tray_num == 0)
		{
			$(".recommand").fadeOut();
		}
		$("input[type='checkbox']").attr("checked", false);
		//=======推薦機種end=========================================
	
	
	//============超過一個關user guide======================================================
		if(_tray_num <= 0)
		{
			$("#user_guide").show();
		}
	
	
	//==================拿資料計算==========================================
	var _array = new Array();
			
	//全部容量
	var _total = new Number;
	
	$(".tray").each(function(){
    	//alert($(this).attr("data-size"))
		_array.push($(this).attr("data-size"));
		
		_total = parseInt(_total) + parseInt($(this).attr("data-size"));
  	});
			
	var _min =  Math.min.apply(Math,_array);//最小容量
	var _max = 	Math.max.apply(Math,_array);//最大容量
			//=============================================================
	
	
	//========分條件=========================================================
	if(_raid_type == 'raid0' && _tray_num >= 0)
	{
		 	//===========派值RAID0=======================
			

			
		 	if(_tray_num >= 1)
			{
		
				 //關閉提示
				 $("#hint").attr("style","display:none;");	
				
				 var _bar1 = 100;
				 $("#prpos").attr("style","float:left;width:"+_bar1+"%");
				 
				 var _bar2 = 0;
				 $("#prpos2").attr("style","float:left;width:"+_bar2+"%");
				 
				 var _bar3 =  0;  
				 $("#prpos3").attr("style","float:left;width:"+_bar3+"%");
				 
					 
				 if(_total <= 999)
				 {
					_total = _total + " GB"
				 }
				 else
				 {
					_total = (_total / 1000)+" TB"	 
				 }
				 
				 $("#prpos").text(_total);
							 
				 $("#prpos2").text('');
	
				 $("#prpos3").text('');
			}
			else
			{
				 //關閉提示
				 $("#hint").attr("style",";");			
			}
			 	
	}
	else if(_raid_type == 'raid1')
	{
			//===========派值RAID1=======================
		if(_tray_num >= 2)
		{	
		 	 //關閉提示
			 $("#hint").attr("style","display:none;");	
			
			 var _bar1 = (_min / _total) * 100;
			 $("#prpos").attr("style","float:left;width:"+_bar1+"%");
			 
			 
			 
			 
			 var _bar2 = (_min / _total) * 100;
			 var _bar2_capacity = _min;
			 
			 
			 $("#prpos2").attr("style","float:left;width:"+_bar1+"%");
			 
			 var _bar3 =  ((_total - (2 * _min)) / _total) * 100;  
			 var _bar3_capacity = _total - (2 *_min);

			 $("#prpos3").attr("style","float:left;width:"+_bar3+"%");
			 
			 	 
			 if(_min <= 999)
			 {
				_min = _min+" GB"
			 }
			 else
			 {
				_min = (_min / 1000)+" TB"	 
			 }
			 
			 $("#prpos").text(_min);
			 
			 
			 if(_bar2_capacity == 0)
			 {
				 _bar2_capacity = '';
			 }
			 else if(_bar2_capacity <= 999)
			 {
				_bar2_capacity = _bar2_capacity +" GB"
			 }
			 else
			 {
				_bar2_capacity = (_bar2_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos2").text(_bar2_capacity);
			 
			 
			 
			 
			 if(_bar3_capacity == 0)
			 {
				 _bar3_capacity = '';
			 }
			 else if(_bar3_capacity <= 999)
			 {
				_bar3_capacity = _bar3_capacity +" GB"
			 }
			 else
			 {
				_bar3_capacity = (_bar3_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos3").text(_bar3_capacity);
			 
			 
 
			 
		}
		else
		{
				 //關閉提示
			 $("#hint").attr("style","");		
		}
	}
	else if(_raid_type == 'raid5')
	{
			//===========派值RAID5=======================
		if(_tray_num >= 3)
		{	
		 	 //關閉提示
			 $("#hint").attr("style","display:none;");	
			
			 var _bar1 = (_min / _total) * 100;
			
			 
			 var _bar2 = (_min * (_tray_num - 1) / _total) * 100;
			 var _bar2_capacity = _min * (_tray_num - 1);
			 
			 
			 $("#prpos2").attr("style","float:left;width:"+_bar1+"%");
			 $("#prpos").attr("style","float:left;width:"+_bar2+"%");
			
			
			 
			 var _bar3 =  ((_total - (_tray_num * _min)) / _total) * 100;  
			 var _bar3_capacity = _total - (_tray_num * _min);

			 $("#prpos3").attr("style","float:left;width:"+_bar3+"%");
			 
			 	 
			 if(_min <= 999)
			 {
				_min = _min+" GB"
			 }
			 else
			 {
				_min = (_min / 1000)+" TB"	 
			 }
			 
			 $("#prpos2").text(_min);
			 
			 
			 if(_bar2_capacity == 0)
			 {
				 _bar2_capacity = '';
			 }
			 else if(_bar2_capacity <= 999)
			 {
				_bar2_capacity = _bar2_capacity +" GB"
			 }
			 else
			 {
				_bar2_capacity = (_bar2_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos").text(_bar2_capacity);
			 
			 
			 
			 
			 if(_bar3_capacity == 0)
			 {
				 _bar3_capacity = '';
			 }
			 else if(_bar3_capacity <= 999)
			 {
				_bar3_capacity = _bar3_capacity +" GB"
			 }
			 else
			 {
				_bar3_capacity = (_bar3_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos3").text(_bar3_capacity);
			 
 
			 
		}
		else
		{
				 //關閉提示
			 $("#hint").attr("style","");		
		}	
	}
	else if(_raid_type == 'raid6')
	{
			//===========派值RAID6=======================
		if(_tray_num >= 4)
		{	
		 	 //關閉提示
			 $("#hint").attr("style","display:none;");	
			
			 var _bar1 = ((_min * (_tray_num - 2)) / _total) * 100;
			  var _bar1_capacity = _min * (_tray_num - 2);
			 
			 $("#prpos").attr("style","float:left;width:"+_bar1+"%");
			 
			 
			 
			 
			 var _bar2 = ((_min * 2) / _total) * 100;
			 var _bar2_capacity = _min * 2;
			 
			
			 
			 
			 
			 $("#prpos2").attr("style","float:left;width:"+_bar2+"%");
			 
			 var _bar3 =  ((_total - (_bar1_capacity + _bar2_capacity)) / _total) * 100;  
			 var _bar3_capacity = _total - (_bar1_capacity + _bar2_capacity);

			 $("#prpos3").attr("style","float:left;width:"+_bar3+"%");
			 
				 
				 
			 if(_bar1_capacity <= 999)
			 {
				_bar1_capacity = _bar1_capacity+" GB"
			 }
			 else
			 {
				_bar1_capacity = (_bar1_capacity / 1000)+" TB"	 
			 }
			 
			 $("#prpos").text(_bar1_capacity);
			 
			 
			 if(_bar2_capacity == 0)
			 {
				 _bar2_capacity = '';
			 }
			 else if(_bar2_capacity <= 999)
			 {
				_bar2_capacity = _bar2_capacity +" GB"
			 }
			 else
			 {
				_bar2_capacity = (_bar2_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos2").text(_bar2_capacity);
			 
			 
			// alert(_bar3_capacity);
			 
			 if(_bar3_capacity == 0)
			 {
				 _bar3_capacity = '';
			 }
			 else if(_bar3_capacity <= 999)
			 {
				_bar3_capacity = _bar3_capacity +" GB"
			 }
			 else
			 {
				_bar3_capacity = (_bar3_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos3").text(_bar3_capacity);
			 
 
			 
		}
		else
		{
				 //關閉提示
			 $("#hint").attr("style","");		
		}	
	}	
	else if(_raid_type == 'raid10')
	{
			//===========派值RAID10=======================
		if(_tray_num >= 4 && _tray_num%2 == 0)
		{	
		 	 //關閉提示
			 $("#hint").attr("style","display:none;");	
			
			 var _bar1 = ((_min * (_tray_num / 2)) / _total) * 100;
			  var _bar1_capacity = _min * (_tray_num / 2);
			 
			 $("#prpos").attr("style","float:left;width:"+_bar1+"%");
			 
			 
			 
			 
			 var _bar2 = ((_min * (_tray_num / 2)) / _total) * 100;
			 var _bar2_capacity = _min * (_tray_num / 2);
			 
			 
			 $("#prpos2").attr("style","float:left;width:"+_bar2+"%");
			 
			 var _bar3 =  ((_total - (_bar1_capacity + _bar2_capacity)) / _total) * 100;  
			 var _bar3_capacity = _total - (_bar1_capacity + _bar2_capacity);

			 $("#prpos3").attr("style","float:left;width:"+_bar3+"%");
			 
				 
				 
			 if(_bar1_capacity <= 999)
			 {
				_bar1_capacity = _bar1_capacity+" GB"
			 }
			 else
			 {
				_bar1_capacity = (_bar1_capacity / 1000)+" TB"	 
			 }
			 
			 $("#prpos").text(_bar1_capacity);
			 
			 
			 if(_bar2_capacity == 0)
			 {
				 _bar2_capacity = '';
			 }
			 else if(_bar2_capacity <= 999)
			 {
				_bar2_capacity = _bar2_capacity +" GB"
			 }
			 else
			 {
				_bar2_capacity = (_bar2_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos2").text(_bar2_capacity);
			 
			 
			 //alert(_bar3_capacity);
			 
			 if(_bar3_capacity == 0)
			 {
				 _bar3_capacity = '';
			 }
			 else if(_bar3_capacity <= 999)
			 {
				_bar3_capacity = _bar3_capacity +" GB"
			 }
			 else
			 {
				_bar3_capacity = (_bar3_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos3").text(_bar3_capacity);
			 
 
			 
		}
		else
		{
				 //關閉提示
			 $("#hint").attr("style","");		
		}		
	}
	
	
	
	
		//==================拿資料計算==========================================
	var _array = new Array();
			
	//全部容量
	var _total = new Number;
	
	$(".tray").each(function(){
    	//alert($(this).attr("data-size"))
		_array.push($(this).attr("data-size"));
		
		_total = parseInt(_total) + parseInt($(this).attr("data-size"));
  	});
			
	var _min =  Math.min.apply(Math,_array);//最小容量
	var _max = 	Math.max.apply(Math,_array);//最大容量
	
	var _raid_type_b = $("#raid_type_b").find(":selected").val(); //下拉選單b type
			//=============================================================
	<!--==========================Bar B==================================================================-->
	if(_raid_type_b == 'raid0' && _tray_num >= 0)
	{
		 	//===========派值RAID0=======================
		if( _tray_num >= 1)
		{
		 	 //關閉提示
			 $("#hint_b").attr("style","display:none;");	
			
			 var _bar1_b = 100;
			 $("#prpos_b").attr("style","float:left;width:"+_bar1_b+"%");
			 
			 var _bar2_b = 0;
			 $("#prpos2_b").attr("style","float:left;width:"+_bar2_b+"%");
			 
			 var _bar3_b =  0;  
			 $("#prpos3_b").attr("style","float:left;width:"+_bar3_b+"%");
			 
			 	 
			 if(_total <= 999)
			 {
				_total = _total + " GB"
			 }
			 else
			 {
				_total = (_total / 1000)+" TB"	 
			 }
			 
			 $("#prpos_b").text(_total);
						 
			 $("#prpos2_b").text('');

			 $("#prpos3_b").text('');
		}
		else
		{
			 $("#hint_b").attr("style","");			
		}
			 	
	}
	else if(_raid_type_b == 'raid1')
	{
			//===========派值RAID1=======================
		if(_tray_num >= 2)
		{	
		 	  //關閉提示
			 $("#hint").attr("style","display:none;");	
			
			 var _bar1 = (_min / _total) * 100;
			 $("#prpos").attr("style","float:left;width:"+_bar1+"%");
			 
			 
			 
			 
			 var _bar2 = (_min / _total) * 100;
			 var _bar2_capacity = _min;
			 
			 
			 $("#prpos2").attr("style","float:left;width:"+_bar1+"%");
			 
			 var _bar3 =  ((_total - (2 * _min)) / _total) * 100;  
			 var _bar3_capacity = _total - (2 *_min);

			 $("#prpos3").attr("style","float:left;width:"+_bar3+"%");
			 
			 	 
			 if(_min <= 999)
			 {
				_min = _min+" GB"
			 }
			 else
			 {
				_min = (_min / 1000)+" TB"	 
			 }
			 
			 $("#prpos").text(_min);
			 
			 
			 if(_bar2_capacity == 0)
			 {
				 _bar2_capacity = '';
			 }
			 else if(_bar2_capacity <= 999)
			 {
				_bar2_capacity = _bar2_capacity +" GB"
			 }
			 else
			 {
				_bar2_capacity = (_bar2_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos2").text(_bar2_capacity);
			 
			 
			 
			 
			 if(_bar3_capacity == 0)
			 {
				 _bar3_capacity = '';
			 }
			 else if(_bar3_capacity <= 999)
			 {
				_bar3_capacity = _bar3_capacity +" GB"
			 }
			 else
			 {
				_bar3_capacity = (_bar3_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos3").text(_bar3_capacity);
			 
			 
 
			 
		}
		else
		{
				 //關閉提示
			 $("#hint_b").attr("style","");		
		}
	}
	else if(_raid_type_b == 'raid5')
	{
			//===========派值RAID5=======================
		if(_tray_num >= 3)
		{	
		 	 //關閉提示
			 $("#hint_b").attr("style","display:none;");	
			
			 var _bar1_b = (_min / _total) * 100;
			
			 
			 var _bar2_b = (_min * (_tray_num - 1) / _total) * 100;
			 var _bar2_b_capacity = _min * (_tray_num - 1);
			 
			 
			 $("#prpos2_b").attr("style","float:left;width:"+_bar1_b+"%");
			 $("#prpos_b").attr("style","float:left;width:"+_bar2_b+"%");
			
			
			 
			 var _bar3_b =  ((_total - (_tray_num * _min)) / _total) * 100;  
			 var _bar3_b_capacity = _total - (_tray_num * _min);

			 $("#prpos3_b").attr("style","float:left;width:"+_bar3_b+"%");
			 
			 	 
			 if(_min <= 999)
			 {
				_min = _min+" GB"
			 }
			 else
			 {
				_min = (_min / 1000)+" TB"	 
			 }
			 
			 $("#prpos2_b").text(_min);
			 
			 
			 if(_bar2_b_capacity == 0)
			 {
				 _bar2_b_capacity = '';
			 }
			 else if(_bar2_b_capacity <= 999)
			 {
				_bar2_b_capacity = _bar2_b_capacity +" GB"
			 }
			 else
			 {
				_bar2_b_capacity = (_bar2_b_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos_b").text(_bar2_b_capacity);
			 
			 
			 
			 
			 if(_bar3_b_capacity == 0)
			 {
				 _bar3_b_capacity = '';
			 }
			 else if(_bar3_b_capacity <= 999)
			 {
				_bar3_b_capacity = _bar3_b_capacity +" GB"
			 }
			 else
			 {
				_bar3_b_capacity = (_bar3_b_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos3_b").text(_bar3_b_capacity);
			 
 
			 
		}
		else
		{
				 //關閉提示
			 $("#hint_b").attr("style","");		
		}	
	}
	else if(_raid_type_b == 'raid6')
	{
			//===========派值RAID6=======================
		if(_tray_num >= 4)
		{	
		 	 //關閉提示
			 $("#hint_b").attr("style","display:none;");	
			
			 var _bar1_b = ((_min * (_tray_num - 2)) / _total) * 100;
			  var _bar1_b_capacity = _min * (_tray_num - 2);
			 
			 $("#prpos_b").attr("style","float:left;width:"+_bar1_b+"%");
			 
			 
			 
			 
			 var _bar2_b = ((_min * 2) / _total) * 100;
			 var _bar2_b_capacity = _min * 2;
			 
			
			 
			 
			 
			 $("#prpos2_b").attr("style","float:left;width:"+_bar2_b+"%");
			 
			 var _bar3_b =  ((_total - (_bar1_b_capacity + _bar2_b_capacity)) / _total) * 100;  
			 var _bar3_b_capacity = _total - (_bar1_b_capacity + _bar2_b_capacity);

			 $("#prpos3_b").attr("style","float:left;width:"+_bar3_b+"%");
			 
				 
				 
			 if(_bar1_b_capacity <= 999)
			 {
				_bar1_b_capacity = _bar1_b_capacity+" GB"
			 }
			 else
			 {
				_bar1_b_capacity = (_bar1_b_capacity / 1000)+" TB"	 
			 }
			 
			 $("#prpos_b").text(_bar1_b_capacity);
			 
			 
			 if(_bar2_b_capacity == 0)
			 {
				 _bar2_b_capacity = '';
			 }
			 else if(_bar2_b_capacity <= 999)
			 {
				_bar2_b_capacity = _bar2_b_capacity +" GB"
			 }
			 else
			 {
				_bar2_b_capacity = (_bar2_b_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos2_b").text(_bar2_b_capacity);
			 
			 
			 //alert(_bar3_b_capacity);
			 
			 if(_bar3_b_capacity == 0)
			 {
				 _bar3_b_capacity = '';
			 }
			 else if(_bar3_b_capacity <= 999)
			 {
				_bar3_b_capacity = _bar3_b_capacity +" GB"
			 }
			 else
			 {
				_bar3_b_capacity = (_bar3_b_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos3_b").text(_bar3_b_capacity);
			 
 
			 
		}
		else
		{
				 //關閉提示
			 $("#hint_b").attr("style","");		
		}	
	}	
	else if(_raid_type_b == 'raid10')
	{
			//===========派值RAID10=======================
		if(_tray_num >= 4 && _tray_num%2 == 0)
		{
			
		 	 //關閉提示
			 $("#hint_b").attr("style","display:none;");	
			
			 var _bar1_b = ((_min * (_tray_num / 2)) / _total) * 100;
			  var _bar1_b_capacity = _min * (_tray_num / 2);
			 
			 $("#prpos_b").attr("style","float:left;width:"+_bar1_b+"%");
			 
			 
			 
			 
			 var _bar2_b = ((_min * (_tray_num / 2)) / _total) * 100;
			 var _bar2_b_capacity = _min * (_tray_num / 2);
			 
			 
			 $("#prpos2_b").attr("style","float:left;width:"+_bar2_b+"%");
			 
			 var _bar3_b =  ((_total - (_bar1_b_capacity + _bar2_b_capacity)) / _total) * 100;  
			 var _bar3_b_capacity = _total - (_bar1_b_capacity + _bar2_b_capacity);

			 $("#prpos3_b").attr("style","float:left;width:"+_bar3_b+"%");
			 
				 
				 
			 if(_bar1_b_capacity <= 999)
			 {
				_bar1_b_capacity = _bar1_b_capacity+" GB"
			 }
			 else
			 {
				_bar1_b_capacity = (_bar1_b_capacity / 1000)+" TB"	 
			 }
			 
			 $("#prpos_b").text(_bar1_b_capacity);
			 
			 
			 if(_bar2_b_capacity == 0)
			 {
				 _bar2_b_capacity = '';
			 }
			 else if(_bar2_b_capacity <= 999)
			 {
				_bar2_b_capacity = _bar2_b_capacity +" GB"
			 }
			 else
			 {
				_bar2_b_capacity = (_bar2_b_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos2_b").text(_bar2_b_capacity);
			 
			 
			 //alert(_bar3_b_capacity);
			 
			 if(_bar3_b_capacity == 0)
			 {
				 _bar3_b_capacity = '';
			 }
			 else if(_bar3_b_capacity <= 999)
			 {
				_bar3_b_capacity = _bar3_b_capacity +" GB"
			 }
			 else
			 {
				_bar3_b_capacity = (_bar3_b_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos3_b").text(_bar3_b_capacity);
			 
 
			 
		}
		else
		{
				 //關閉提示
			 $("#hint_b").attr("style","");		
		}		
	}
	<!--========================Bar B end=======================================================================-->
	
		
	
	
	
	
	
	
	
	
	
		
});
	
	
	
	
	
	
	
	
	
	
	
//====================Raid_type改變========================================================
	

$("#raid_type").change(function()
{
	var _raid_type = $("#raid_type").find(":selected").val();
	
	
	var _tray_num = $('#tray_out').children('li').length - 1;
	//==================拿資料計算==========================================
	var _array = new Array();
			
	//全部容量
	var _total = new Number;
	
	$(".tray").each(function(){
    	//alert($(this).attr("data-size"))
		_array.push($(this).attr("data-size"));
		
		_total = parseInt(_total) + parseInt($(this).attr("data-size"));
  	});
			
	var _min =  Math.min.apply(Math,_array);//最小容量
	var _max = 	Math.max.apply(Math,_array);//最大容量
			//=============================================================
	
	
	//========分條件=========================================================
	if(_raid_type == 'raid0' && _tray_num >= 1)
	{
		 	//===========派值RAID0=======================
		
		 	 //關閉提示
			 $("#hint").attr("style","display:none;");	
			
			 var _bar1 = 100;
			 $("#prpos").attr("style","float:left;width:"+_bar1+"%");
			 
			 var _bar2 = 0;
			 $("#prpos2").attr("style","float:left;width:"+_bar2+"%");
			 
			 var _bar3 =  0;  
			 $("#prpos3").attr("style","float:left;width:"+_bar3+"%");
			 
			 	 
			 if(_total <= 999)
			 {
				_total = _total + " GB"
			 }
			 else
			 {
				_total = (_total / 1000)+" TB"	 
			 }
			 
			 $("#prpos").text(_total);
						 
			 $("#prpos2").text('');

			 $("#prpos3").text('');
			 	
	}
	else if(_raid_type == 'raid1')
	{
			//===========派值RAID1=======================
		if(_tray_num >= 2)
		{	
		 	  //關閉提示
			 $("#hint").attr("style","display:none;");	
			
			 var _bar1 = (_min / _total) * 100;
			 $("#prpos").attr("style","float:left;width:"+_bar1+"%");
			 
			 
			 
			 
			 var _bar2 = (_min / _total) * 100;
			 var _bar2_capacity = _min;
			 
			 
			 $("#prpos2").attr("style","float:left;width:"+_bar1+"%");
			 
			 var _bar3 =  ((_total - (2 * _min)) / _total) * 100;  
			 var _bar3_capacity = _total - (2 *_min);

			 $("#prpos3").attr("style","float:left;width:"+_bar3+"%");
			 
			 	 
			 if(_min <= 999)
			 {
				_min = _min+" GB"
			 }
			 else
			 {
				_min = (_min / 1000)+" TB"	 
			 }
			 
			 $("#prpos").text(_min);
			 
			 
			 if(_bar2_capacity == 0)
			 {
				 _bar2_capacity = '';
			 }
			 else if(_bar2_capacity <= 999)
			 {
				_bar2_capacity = _bar2_capacity +" GB"
			 }
			 else
			 {
				_bar2_capacity = (_bar2_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos2").text(_bar2_capacity);
			 
			 
			 
			 
			 if(_bar3_capacity == 0)
			 {
				 _bar3_capacity = '';
			 }
			 else if(_bar3_capacity <= 999)
			 {
				_bar3_capacity = _bar3_capacity +" GB"
			 }
			 else
			 {
				_bar3_capacity = (_bar3_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos3").text(_bar3_capacity);
			 
			 
 
			 
		}
		else
		{
				 //關閉提示
			 $("#hint").attr("style","");		
		}
	}
	else if(_raid_type == 'raid5')
	{
			//===========派值RAID5=======================
		if(_tray_num >= 3)
		{	
		 	 //關閉提示
			 $("#hint").attr("style","display:none;");	
			
			 var _bar1 = (_min / _total) * 100;
			
			 
			 var _bar2 = (_min * (_tray_num - 1) / _total) * 100;
			 var _bar2_capacity = _min * (_tray_num - 1);
			 
			 
			 $("#prpos2").attr("style","float:left;width:"+_bar1+"%");
			 $("#prpos").attr("style","float:left;width:"+_bar2+"%");
			
			
			 
			 var _bar3 =  ((_total - (_tray_num * _min)) / _total) * 100;  
			 var _bar3_capacity = _total - (_tray_num * _min);

			 $("#prpos3").attr("style","float:left;width:"+_bar3+"%");
			 
			 	 
			 if(_min <= 999)
			 {
				_min = _min+" GB"
			 }
			 else
			 {
				_min = (_min / 1000)+" TB"	 
			 }
			 
			 $("#prpos2").text(_min);
			 
			 
			 if(_bar2_capacity == 0)
			 {
				 _bar2_capacity = '';
			 }
			 else if(_bar2_capacity <= 999)
			 {
				_bar2_capacity = _bar2_capacity +" GB"
			 }
			 else
			 {
				_bar2_capacity = (_bar2_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos").text(_bar2_capacity);
			 
			 
			 
			 
			 if(_bar3_capacity == 0)
			 {
				 _bar3_capacity = '';
			 }
			 else if(_bar3_capacity <= 999)
			 {
				_bar3_capacity = _bar3_capacity +" GB"
			 }
			 else
			 {
				_bar3_capacity = (_bar3_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos3").text(_bar3_capacity);
			 
 
			 
		}
		else
		{
				 //關閉提示
			 $("#hint").attr("style","");		
		}	
	}
	else if(_raid_type == 'raid6')
	{
			//===========派值RAID6=======================
		if(_tray_num >= 4)
		{	
		 	 //關閉提示
			 $("#hint").attr("style","display:none;");	
			
			 var _bar1 = ((_min * (_tray_num - 2)) / _total) * 100;
			  var _bar1_capacity = _min * (_tray_num - 2);
			 
			 $("#prpos").attr("style","float:left;width:"+_bar1+"%");
			 
			 
			 
			 
			 var _bar2 = ((_min * 2) / _total) * 100;
			 var _bar2_capacity = _min * 2;
			 
			
			 
			 
			 
			 $("#prpos2").attr("style","float:left;width:"+_bar2+"%");
			 
			 var _bar3 =  ((_total - (_bar1_capacity + _bar2_capacity)) / _total) * 100;  
			 var _bar3_capacity = _total - (_bar1_capacity + _bar2_capacity);

			 $("#prpos3").attr("style","float:left;width:"+_bar3+"%");
			 
				 
				 
			 if(_bar1_capacity <= 999)
			 {
				_bar1_capacity = _bar1_capacity+" GB"
			 }
			 else
			 {
				_bar1_capacity = (_bar1_capacity / 1000)+" TB"	 
			 }
			 
			 $("#prpos").text(_bar1_capacity);
			 
			 
			 if(_bar2_capacity == 0)
			 {
				 _bar2_capacity = '';
			 }
			 else if(_bar2_capacity <= 999)
			 {
				_bar2_capacity = _bar2_capacity +" GB"
			 }
			 else
			 {
				_bar2_capacity = (_bar2_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos2").text(_bar2_capacity);
			 
			 
			 //alert(_bar3_capacity);
			 
			 if(_bar3_capacity == 0)
			 {
				 _bar3_capacity = '';
			 }
			 else if(_bar3_capacity <= 999)
			 {
				_bar3_capacity = _bar3_capacity +" GB"
			 }
			 else
			 {
				_bar3_capacity = (_bar3_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos3").text(_bar3_capacity);
			 
 
			 
		}
		else
		{
				 //關閉提示
			 $("#hint").attr("style","");		
		}	
	}	
	else if(_raid_type == 'raid10')
	{
			//===========派值RAID10=======================
		if(_tray_num >= 4 && _tray_num%2 == 0)
		{	
		 	 //關閉提示
			 $("#hint").attr("style","display:none;");	
			
			 var _bar1 = ((_min * (_tray_num / 2)) / _total) * 100;
			  var _bar1_capacity = _min * (_tray_num / 2);
			 
			 $("#prpos").attr("style","float:left;width:"+_bar1+"%");
			 
			 
			 
			 
			 var _bar2 = ((_min * (_tray_num / 2)) / _total) * 100;
			 var _bar2_capacity = _min * (_tray_num / 2);
			 
			 
			 $("#prpos2").attr("style","float:left;width:"+_bar2+"%");
			 
			 var _bar3 =  ((_total - (_bar1_capacity + _bar2_capacity)) / _total) * 100;  
			 var _bar3_capacity = _total - (_bar1_capacity + _bar2_capacity);

			 $("#prpos3").attr("style","float:left;width:"+_bar3+"%");
			 
				 
				 
			 if(_bar1_capacity <= 999)
			 {
				_bar1_capacity = _bar1_capacity+" GB"
			 }
			 else
			 {
				_bar1_capacity = (_bar1_capacity / 1000)+" TB"	 
			 }
			 
			 $("#prpos").text(_bar1_capacity);
			 
			 
			 if(_bar2_capacity == 0)
			 {
				 _bar2_capacity = '';
			 }
			 else if(_bar2_capacity <= 999)
			 {
				_bar2_capacity = _bar2_capacity +" GB"
			 }
			 else
			 {
				_bar2_capacity = (_bar2_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos2").text(_bar2_capacity);
			 
			 
			 //alert(_bar3_capacity);
			 
			 if(_bar3_capacity == 0)
			 {
				 _bar3_capacity = '';
			 }
			 else if(_bar3_capacity <= 999)
			 {
				_bar3_capacity = _bar3_capacity +" GB"
			 }
			 else
			 {
				_bar3_capacity = (_bar3_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos3").text(_bar3_capacity);
			 
 
			 
		}
		else
		{
				 //關閉提示
			 $("#hint").attr("style","");		
		}		
	}
	
	
		
		
	})


	$("#raid_type_b").change(function()
	{
		
		//alert('123123');
		
		var _raid_type_b = $("#raid_type_b").find(":selected").val(); //下拉選單b type
	
	
	var _tray_num = $('#tray_out').children('li').length - 1;
		
		//==================拿資料計算==========================================
		var _array = new Array();
				
		//全部容量
		var _total = new Number;
		
		$(".tray").each(function(){
			//alert($(this).attr("data-size"))
			_array.push($(this).attr("data-size"));
			
			_total = parseInt(_total) + parseInt($(this).attr("data-size"));
		});
				
		var _min =  Math.min.apply(Math,_array);//最小容量
		var _max = 	Math.max.apply(Math,_array);//最大容量
		
		
				//=============================================================
		<!--==========================Bar B==================================================================-->
		if(_raid_type_b == 'raid0' && _tray_num >= 1)
		{
				//===========派值RAID0=======================
			
				 //關閉提示
				 $("#hint_b").attr("style","display:none;");	
				
				 var _bar1_b = 100;
				 $("#prpos_b").attr("style","float:left;width:"+_bar1_b+"%");
				 
				 var _bar2_b = 0;
				 $("#prpos2_b").attr("style","float:left;width:"+_bar2_b+"%");
				 
				 var _bar3_b =  0;  
				 $("#prpos3_b").attr("style","float:left;width:"+_bar3_b+"%");
				 
					 
				 if(_total <= 999)
				 {
					_total = _total + " GB"
				 }
				 else
				 {
					_total = (_total / 1000)+" TB"	 
				 }
				 
				 $("#prpos_b").text(_total);
							 
				 $("#prpos2_b").text('');
	
				 $("#prpos3_b").text('');
					
		}
		else if(_raid_type_b == 'raid1')
		{
				//===========派值RAID1=======================
			if(_tray_num >= 2)
			{	
				  //關閉提示
			 $("#hint").attr("style","display:none;");	
			
			 var _bar1 = (_min / _total) * 100;
			 $("#prpos").attr("style","float:left;width:"+_bar1+"%");
			 
			 
			 
			 
			 var _bar2 = (_min / _total) * 100;
			 var _bar2_capacity = _min;
			 
			 
			 $("#prpos2").attr("style","float:left;width:"+_bar1+"%");
			 
			 var _bar3 =  ((_total - (2 * _min)) / _total) * 100;  
			 var _bar3_capacity = _total - (2 *_min);

			 $("#prpos3").attr("style","float:left;width:"+_bar3+"%");
			 
			 	 
			 if(_min <= 999)
			 {
				_min = _min+" GB"
			 }
			 else
			 {
				_min = (_min / 1000)+" TB"	 
			 }
			 
			 $("#prpos").text(_min);
			 
			 
			 if(_bar2_capacity == 0)
			 {
				 _bar2_capacity = '';
			 }
			 else if(_bar2_capacity <= 999)
			 {
				_bar2_capacity = _bar2_capacity +" GB"
			 }
			 else
			 {
				_bar2_capacity = (_bar2_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos2").text(_bar2_capacity);
			 
			 
			 
			 
			 if(_bar3_capacity == 0)
			 {
				 _bar3_capacity = '';
			 }
			 else if(_bar3_capacity <= 999)
			 {
				_bar3_capacity = _bar3_capacity +" GB"
			 }
			 else
			 {
				_bar3_capacity = (_bar3_capacity / 1000)+" TB"	 
			 }
			 
			  $("#prpos3").text(_bar3_capacity);
			 
				 
	 
				 
			}
			else
			{
					 //關閉提示
				 $("#hint_b").attr("style","");		
			}
		}
		else if(_raid_type_b == 'raid5')
		{
				//===========派值RAID5=======================
			if(_tray_num >= 3)
			{	
				 //關閉提示
				 $("#hint_b").attr("style","display:none;");	
				
				 var _bar1_b = (_min / _total) * 100;
				
				 
				 var _bar2_b = (_min * (_tray_num - 1) / _total) * 100;
				 var _bar2_b_capacity = _min * (_tray_num - 1);
				 
				 
				 $("#prpos2_b").attr("style","float:left;width:"+_bar1_b+"%");
				 $("#prpos_b").attr("style","float:left;width:"+_bar2_b+"%");
				
				
				 
				 var _bar3_b =  ((_total - (_tray_num * _min)) / _total) * 100;  
				 var _bar3_b_capacity = _total - (_tray_num * _min);
	
				 $("#prpos3_b").attr("style","float:left;width:"+_bar3_b+"%");
				 
					 
				 if(_min <= 999)
				 {
					_min = _min+" GB"
				 }
				 else
				 {
					_min = (_min / 1000)+" TB"	 
				 }
				 
				 $("#prpos2_b").text(_min);
				 
				 
				 if(_bar2_b_capacity == 0)
				 {
					 _bar2_b_capacity = '';
				 }
				 else if(_bar2_b_capacity <= 999)
				 {
					_bar2_b_capacity = _bar2_b_capacity +" GB"
				 }
				 else
				 {
					_bar2_b_capacity = (_bar2_b_capacity / 1000)+" TB"	 
				 }
				 
				  $("#prpos_b").text(_bar2_b_capacity);
				 
				 
				 
				 
				 if(_bar3_b_capacity == 0)
				 {
					 _bar3_b_capacity = '';
				 }
				 else if(_bar3_b_capacity <= 999)
				 {
					_bar3_b_capacity = _bar3_b_capacity +" GB"
				 }
				 else
				 {
					_bar3_b_capacity = (_bar3_b_capacity / 1000)+" TB"	 
				 }
				 
				  $("#prpos3_b").text(_bar3_b_capacity);	 
				 
			}
			else
			{
					 //關閉提示
				 $("#hint_b").attr("style","");		
			}	
		}
		else if(_raid_type_b == 'raid6')
		{
				//===========派值RAID6=======================
			if(_tray_num >= 4)
			{	
				 //關閉提示
				 $("#hint_b").attr("style","display:none;");	
				
				 var _bar1_b = ((_min * (_tray_num - 2)) / _total) * 100;
				  var _bar1_b_capacity = _min * (_tray_num - 2);
				 
				 $("#prpos_b").attr("style","float:left;width:"+_bar1_b+"%");
		 
				 var _bar2_b = ((_min * 2) / _total) * 100;
				 var _bar2_b_capacity = _min * 2;
 
				 
				 $("#prpos2_b").attr("style","float:left;width:"+_bar2_b+"%");
				 
				 var _bar3_b =  ((_total - (_bar1_b_capacity + _bar2_b_capacity)) / _total) * 100;  
				 var _bar3_b_capacity = _total - (_bar1_b_capacity + _bar2_b_capacity);
	
				 $("#prpos3_b").attr("style","float:left;width:"+_bar3_b+"%");
 
				 if(_bar1_b_capacity <= 999)
				 {
					_bar1_b_capacity = _bar1_b_capacity+" GB"
				 }
				 else
				 {
					_bar1_b_capacity = (_bar1_b_capacity / 1000)+" TB"	 
				 }
				 
				 $("#prpos_b").text(_bar1_b_capacity);
				 
				 
				 if(_bar2_b_capacity == 0)
				 {
					 _bar2_b_capacity = '';
				 }
				 else if(_bar2_b_capacity <= 999)
				 {
					_bar2_b_capacity = _bar2_b_capacity +" GB"
				 }
				 else
				 {
					_bar2_b_capacity = (_bar2_b_capacity / 1000)+" TB"	 
				 }
				 
				  $("#prpos2_b").text(_bar2_b_capacity);
				 
				 
				 //alert(_bar3_b_capacity);
				 
				 if(_bar3_b_capacity == 0)
				 {
					 _bar3_b_capacity = '';
				 }
				 else if(_bar3_b_capacity <= 999)
				 {
					_bar3_b_capacity = _bar3_b_capacity +" GB"
				 }
				 else
				 {
					_bar3_b_capacity = (_bar3_b_capacity / 1000)+" TB"	 
				 }			 
				  $("#prpos3_b").text(_bar3_b_capacity);		 
			}
			else
			{
					 //關閉提示
				 $("#hint_b").attr("style","");		
			}	
		}	
		else if(_raid_type_b == 'raid10')
		{
				//===========派值RAID10=======================
			if(_tray_num >= 4 && _tray_num%2 == 0)
			{	
				 //關閉提示
				 $("#hint_b").attr("style","display:none;");	
				
				 var _bar1_b = ((_min * (_tray_num / 2)) / _total) * 100;
				  var _bar1_b_capacity = _min * (_tray_num / 2);
				 
				 $("#prpos_b").attr("style","float:left;width:"+_bar1_b+"%");
				 var _bar2_b = ((_min * (_tray_num / 2)) / _total) * 100;
				 var _bar2_b_capacity = _min * (_tray_num / 2);				 
				 $("#prpos2_b").attr("style","float:left;width:"+_bar2_b+"%");	 
				 var _bar3_b =  ((_total - (_bar1_b_capacity + _bar2_b_capacity)) / _total) * 100;  
				 var _bar3_b_capacity = _total - (_bar1_b_capacity + _bar2_b_capacity);
	
				 $("#prpos3_b").attr("style","float:left;width:"+_bar3_b+"%");
				 
					 
					 
				 if(_bar1_b_capacity <= 999)
				 {
					_bar1_b_capacity = _bar1_b_capacity+" GB"
				 }
				 else
				 {
					_bar1_b_capacity = (_bar1_b_capacity / 1000)+" TB"	 
				 }
				 
				 $("#prpos_b").text(_bar1_b_capacity);
				 
				 
				 if(_bar2_b_capacity == 0)
				 {
					 _bar2_b_capacity = '';
				 }
				 else if(_bar2_b_capacity <= 999)
				 {
					_bar2_b_capacity = _bar2_b_capacity +" GB"
				 }
				 else
				 {
					_bar2_b_capacity = (_bar2_b_capacity / 1000)+" TB"	 
				 }
				 
				  $("#prpos2_b").text(_bar2_b_capacity);
				 
				 
				 //alert(_bar3_b_capacity);
				 
				 if(_bar3_b_capacity == 0)
				 {
					 _bar3_b_capacity = '';
				 }
				 else if(_bar3_b_capacity <= 999)
				 {
					_bar3_b_capacity = _bar3_b_capacity +" GB"
				 }
				 else
				 {
					_bar3_b_capacity = (_bar3_b_capacity / 1000)+" TB"	 
				 }
				 
				  $("#prpos3_b").text(_bar3_b_capacity);
				 

			}
			else
			{
					 //關閉提示
				 $("#hint_b").attr("style","");		
			}		
		}
		<!--========================Bar B end=======================================================================-->

	})
	
})  

</script>
